package com.yida.gwj.common.domain.mq;

/**
 * mq发送结果
 *
 * @author liangp
 * @date 2023/02/15
 */


public class MqSendResult {

    /**
     * 是否成功
     */
    private boolean success;

    /**
     * 信息
     */
    private String message;

    private MqSendResult(Builder builder) {
        setSuccess(builder.success);
        setMessage(builder.message);
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "MqSendResult{" +
                "success=" + success +
                ", message='" + message + '\'' +
                '}';
    }

    public static final class Builder {
        private boolean success;
        private String message;

        public Builder() {
        }

        public Builder success(boolean val) {
            success = val;
            return this;
        }

        public Builder message(String val) {
            message = val;
            return this;
        }

        public MqSendResult build() {
            return new MqSendResult(this);
        }
    }
}
